package cn.iocoder.yudao.module.trade.api.record;

import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.trade.api.record.dto.BrokerRecordDTO;
import cn.iocoder.yudao.module.trade.dal.dataobject.brokerage.BrokerageRecordDO;
import cn.iocoder.yudao.module.trade.dal.dataobject.brokerage.BrokerageUserDO;
import cn.iocoder.yudao.module.trade.dal.mysql.brokerage.BrokerageRecordMapper;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;

import javax.annotation.Resource;

/**
 * @author zyc
 * @createDate 2024/6/14 11:31
 */
@Service
@Validated
public class BrokerageRecordApiImpl implements BrokerageRecordApi{

    @Resource
    private BrokerageRecordMapper brokerageRecordMapper;

    @Override
    public Integer insertRecord(BrokerRecordDTO dto) {
        BrokerageRecordDO bean = BeanUtils.toBean(dto, BrokerageRecordDO.class);
        brokerageRecordMapper.insert(bean);
        return bean.getId();

    }
}
